<?php
/**
 * Created by PhpStorm.
 * User: caipeichao
 * Date: 1/17/14
 * Time: 7:51 PM
 */

namespace Ucenter\Model;

use Think\Model;

class SessionModel extends Model
{
		function setSession($session_id,$session){
			$data['session_id']=$session_id;
			$data['session_expire']=time();
			$data['session_data']=json_encode($session);
		return   $this->add($data);

		
		}
		function getSession($session_id){
			$val=$this->where('session_id="'.$session_id.'"')->find();
		
			return json_decode($val['session_data'],true);
		}
}